import request from '../../utils/request'

export function listStudent(query: any) {
  return request({
    url: '/system/student/list',
    method: 'get',
    params: query
  })
}

export function getStudent(id: number) {
  return request({
    url: `/system/student/${id}`,
    method: 'get'
  })
}

export function addStudent(data: any) {
  return request({
    url: '/system/student',
    method: 'post',
    data
  })
}

export function updateStudent(data: any) {
  return request({
    url: '/system/student',
    method: 'put',
    data
  })
}

export function delStudent(ids: string | number) {
  return request({
    url: `/system/student/${ids}`,
    method: 'delete'
  })
}

export function exportStudent(params?: any) {
  // 若你项目未封装 proxy.download，此方法仍可直接下载 blob
  return request({
    url: '/system/student/export',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
